package com.ytweb.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;

import com.ytweb.model.People;

@Repository
public interface PeopleDao {
	 @Results(id = "PeopleResult", value = {
			    @Result(property = "id", column = "cid", id = true),
		        @Result(property = "cname", column = "cname", id = true),
		        @Result(property = "hno", column = "h_no", id = true),
		        @Result(property = "sno", column = "s_no", id = true),
		        @Result(property = "bno", column = "b_no", id = true),
		        @Result(property = "recordtime", column = "record_time", id = true),
		        @Result(property = "tname", column = "tname", id = true)
		    })
	 //@ResultMap("PeopleResult")
	 @Select("SELECT cid,cname,h_no,s_no,b_no,record_time,tname FROM crm_c,crm_t WHERE crm_c.tid=crm_t.tid")
	    List<People> getPeopleList(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

	 @Select("SELECT count(1) FROM crm_c")
	    int countNumb();

}
